﻿
@model List<VietPublisher.BSL.BK.T_BK_Publisher>



<script type="text/javascript" charset="utf-8">
    var oTable;
    $(document).ready(function () {
        $('#example').dataTable({
            "sScrollY": "200px",
            "bPaginate": true
            // "bSort": false
            //"bFilter": false //search textbox is disable

        });



        /* Add a click handler to the rows - this could be used as a callback */
        $("#example tbody tr").click(function (e) {
            var data = oTable.fnGetData(this);
            alert("PublisherID : " + data[2]); //id of TR

            if ($(this).hasClass('row_selected')) {
                $(this).removeClass('row_selected');
            }
            else {
                oTable.$('tr.row_selected').removeClass('row_selected');

                $(this).addClass('row_selected');
            }
        });


        /* Init the table */
        oTable = $('#example').dataTable();
    });
    </script>


    

<table  id="example"   class="display"  width="100%">
    <thead>
        <tr class="">
            <th>
                Number ID
            </th>
            <th>
                Publisher Name
            </th>
            <th style="display:none;"></th>
        </tr>
    </thead>
    <tbody>
  
      @{
          int i = 0;
          }
        @foreach (var publisher in Model)
        {
            i++;
            <tr>
                <td> @i
                <input type="hidden" value="@publisher.PublisherID" />
                </td>
                <td>@publisher.PublisherName
                </td>
                <td style="display:none;">@publisher.PublisherID</td>
                
            </tr>
        }
    </tbody>
</table>

